<?php
if(isset($_GET['lang']))
{
	if(in_array($_GET['lang'],$Languages))
	{
		gpc_setCookie('lang',$_GET['lang'],0,0);
		if(!empty($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'],"?lang")===false)
		{
			header("location: ".$_SERVER['HTTP_REFERER']);
		}
	}
}
if(isset($_COOKIE['lang']))
{
	if(in_array($_COOKIE['lang'],$Languages))
	{
		$language=$_COOKIE['lang'];		
	}
}
//include lang root
@include("../language/".$language.".php");
//include lang admin
@include("language/".$language.".php");
?>